<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<body>
     名字:<input type="text" placeholder="请输入你编辑的名字" class="ename">
     <br>
     班级:<input type="text" placeholder="请输入你要编辑的班级" class="eclassname">
     <br>
     <input type="button" value="保存" onclick="todo()"> 
     <input type="button" value="取消" onclick="tofixit()">
</body>
</html>
<script src="./axios.min.js"></script>
<script src="./jquery-3.7.1.min (1).js"></script>
<script src="./index.js"></script>
<script>
const id = new URLSearchParams(location.search).get('id')
console.log(id);

window.addEventListener('load', function () {
    axios.get(`${url}/${id}`)
        .then(response => {
            const book = response.data; 
            document.querySelector('.ename').value = book.name;
            document.querySelector('.eclassname').value = book.className;
        })})


</script>